package com.java.model;

import java.util.List;

import javax.swing.table.DefaultTableModel;

import com.java.entity.Patient;

/**
* @ClassName: PatientTableModel
* @Description: 患者表格映射实体类
* @author ChenJiaLu
* @date 2023年12月29日 上午10:50:59
*
 */
public class PatientTableModel extends DefaultTableModel {  
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public PatientTableModel(List<Patient> data) {  
        super(new Object[]{"编号", "姓名", "性别", "年龄", "病情", "密码"}, 0);
        for (Patient doc : data) {  
            addRow(new Object[]{
            		doc.getNumber(), 
            		doc.getName(),
            		doc.getSex(),
            		doc.getAge(),
            		doc.getDisease(),
            		doc.getPassword()
            		});
        }  
    }  
	
	@Override
	public boolean isCellEditable(int row, int column) {
		return false;
	}
}